<template>
  <a-modal
    :visible="visible"
    title="运行状态查看"
    cancelText="取消"
    okText="确定"
    @ok="submit"
    @cancel="cancel"
  >
  <el-tag>标签一</el-tag>
  <el-tag type="success">标签二</el-tag>
  <el-tag type="info">标签三</el-tag>
  <el-tag type="warning">标签四</el-tag>
  <el-tag type="danger">标签五</el-tag>

    <a-form ref="formRef"
      :model="formState"
      :rules="formRules"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
      >
      <a-form-item ref="hostName" label="主机名" name="hostName">
        <a-textarea v-model:value="formState.hostName" />
      </a-form-item>
    </a-form>
  </a-modal>
</template>


<!-- 以下是 script -->
<script>
import { defineComponent, reactive, ref, toRaw, watch } from "vue";

export default defineComponent({
  props: {
    visible: {
      type: Boolean,
    },
    record: {
      type: Object,
    }
  },
  emit: ["close"],
  setup(props, context) {
    const formRef = ref();
    const formState = reactive({});
    watch(props, (props) => {
        formState.hostName = props.record.sysInfo.info
    })

    const formRules = {};
    const submit = (e) => {
      formRef.value.resetFields();
      context.emit("close", false);
    };

    const cancel = (e) => {
      formRef.value.resetFields();
      context.emit("close", false);
    };

    return {
      submit,
      cancel,
      formRef,
      formState,
      formRules,
      labelCol: { span: 6 },
      wrapperCol: { span: 18 },
    };
  },
});
</script>
